//
//  UITabBar.h
//  HCHK_iphone
//
//  Created by yilong zhang on 12-3-21.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@class CTabBarItem;
@class UITabBarEx;


//================================================================================================================

@protocol TabBarExItemDelegate <NSObject>

@optional 
-(void)DidTabBarItemSelected:(CTabBarItem*)item;

@end

//================================================================================================================

@interface CTabBarItem : UIView

@property (nonatomic, assign) id<TabBarExItemDelegate>    delegate;

@property (nonatomic, retain) NSString      *m_NormalPath;
@property (nonatomic, retain) NSString      *m_SelectedPath;
@property (nonatomic, assign) UIButton      *m_BackGroundImage;
@property (nonatomic, assign) UILabel       *m_Text;
@property (nonatomic, assign) BOOL          m_IsSelected;

-(id)initWithImageSourcePath:(NSString*)normalpath SelectedPath:(NSString*)selectedpath Text:(NSString*)text;
-(void)LayoutSubviews;
-(void)SetValue:(BOOL)value;
-(void)OnButtonDown:(UIButton*)sender;

@end


//================================================================================================================

@protocol TabBarExDelegate <NSObject>

@optional
-(void)TabBarEx:(UITabBarEx*)tabbar TabBarItem:(CTabBarItem*)tabbaritem;

@end

//================================================================================================================

@interface UITabBarEx : UIView <TabBarExItemDelegate>

@property (nonatomic, assign) id<TabBarExDelegate> delegate;

@property (nonatomic, assign) UIImageView   *m_Cursor;
@property (nonatomic, assign) int           m_nOldCursor;
@property (nonatomic, retain) NSArray       *m_Items;;

-(void)SetItems:(NSArray*)items;
-(void)SetSelectedItem:(CTabBarItem*)item;
-(void)SetItemHight:(CTabBarItem*)item IsHight:(BOOL)ishight;
-(int)GetCursor;
-(int)GetProCursor;


@end
